﻿define(function(require,exports,module) {
	// var myPub = require('./public');
    var setJSon = [{
        value: '0',
        text: '全部'
    },{
        value: '1',
        text: '0-999'
    }, {
        value: '2',
        text: '1000-4999'
    }, {
        value: '3',
        text: '5000-10000'
    }, {
        value: '4',
        text: '10000-50000'
    }, {
        value: '5',
        text: '50000以上'
    }];

    function GetSeletValue(fn) {
        (function($, doc) {
            $.init();
            $.ready(function() {
                //普通示例
                var userPicker = new $.PopPicker();
                userPicker.setData(setJSon);

                var showUserPickerButton = doc.getElementById('js_showUserPicker');
                showUserPickerButton.addEventListener('tap', function(event) {
                    userPicker.show(function(items) {
                        // console.log(items[0].value)
                        // console.log(items[0].text)

                        if(fn)fn(items[0]);
                        // userResult.innerText = JSON.stringify(items[0]);
                        //返回 false 可以阻止选择框的关闭
                        //return false;
                    });
                }, false);

            });
        })(mui, document);
    }

    exports.GetSeletValue = GetSeletValue;
    exports.setJSon = setJSon;

});



